<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<script type="text/javascript">

    $("#contentTable").treeTable({expandLevel: 3});
</script>
<div class="content-wrap">
    <div class="wrapper" style="bottom: 50px;">
        <ul class="nav nav-tabs">
            <li class="active">
                <a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/csm/expClassDict/index')">消耗品类别字典表列表</a>
            </li>
            <li>
                <a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/csm/expClassDict/form')">消耗品类别字典表添加</a>
            </li>
        </ul>
        <section class="panel panel-default">
            <div class="panel-body">
                <div class="table-responsive no-border">
                    <div class="datatable-top">
                        <div class="pull-left">
                            <form:form id="searchForm" modelAttribute="expClassDict" onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/csm/expClassDict/index');" method="post"
                                       class="form-inline">
                                <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
                                <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}" />
                                <label>类别代码 ：</label><form:input path="classCode" htmlEscape="false" maxlength="50" class="form-control" />
                                &nbsp;&nbsp;<label>类别名称 ：</label><form:input path="className" htmlEscape="false" maxlength="50" class="form-control" />
                                <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" />
                            </form:form>
                        </div>
                    </div>
                    <table id="contentTable" class="table table-bordered mg-t datatable">
                        <thead>
                        <tr>
                            <th>类别代码</th>
                            <th>类别名称</th>
                            <th>备注信息</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${list}" var="expClassDict">
                        <c:choose>
                        <c:when test="${!empty expClassDict.parent.id}">
                        <tr id='${expClassDict.id}' pId='${expClassDict.parent.id}'>
                            </c:when>
                            <c:otherwise>
                        <tr id='${expClassDict.id}'>
                            </c:otherwise>
                            </c:choose>
                            <td> ${expClassDict.classCode}</td>
                            <td> ${expClassDict.className}</td>

                            <td> ${expClassDict.remarks}</td>
                            <td>
                                <a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/csm/expClassDict/form?id=${expClassDict.id}')" class="btn btn-success btn-xs">修改</a>
                                <a href="#" class="applyBt btn btn-danger btn-xs"
                                   onclick="confirmExtend('确认要删除该类别字典表吗？',function(){delLoad('mainCenterDiv','${ctx}/csm/expClassDict/delete?id=${expClassDict.id}','${ctx}/csm/expClassDict/index')})">删除</a>
                            </td>
                        </tr>
                        </c:forEach>

                    </table>
                    <%-- <div class="pagination">${page}</div>--%>
                </div>
            </div>
        </section>
    </div>
</div>